package us.wili.dev.client.service.impl;

import org.springframework.stereotype.Service;
import us.wili.dev.client.dao.ClientCompanyMapper;
import us.wili.dev.client.model.rsp.CompanyRsp;
import us.wili.dev.client.service.ClientCompanyService;
import us.wili.dev.model.entity.Company;
import us.wili.dev.model.example.CompanyExample;
import us.wili.dev.service.impl.BaseCompanyServiceImpl;

import javax.annotation.Resource;

@Service
public class ClientCompanyServiceImpl extends BaseCompanyServiceImpl implements ClientCompanyService {
    @Resource
    private ClientCompanyMapper clientCompanyMapper;

    @Override
    public CompanyRsp company() {
        Company company = searCompany();
        return CompanyRsp.company(company);
    }

    @Override
    public CompanyRsp ContactUs() {
        Company company = searCompany();
        return CompanyRsp.contactus(company);
    }

    public Company searCompany(){
        CompanyExample example = new CompanyExample();
        example.createCriteria();
        return clientCompanyMapper.selectOneByExample(example);
    }
}
